import { useMemo } from 'react';
import WillPayList from './WillPayList/WillPayList';
import PayedList from './PayedList/PayedList';
import CancleList from './CancleList/CancleList';
import AllOrderList from './AllOrderList/AllOrderList';

export const useOptionsRender = (orderClass: string, height: number) => {
    // eslint-disable-next-line react-hooks/exhaustive-deps
    const CompObj = {
        WillPayList: <WillPayList style={{ height: height + 'px' }}></WillPayList>,
        PayedList: <PayedList style={{ height: height + 'px' }}></PayedList>,
        CancleList: <CancleList style={{ height: height + 'px' }}></CancleList>,
        AllOrderList: <AllOrderList style={{ height: height + 'px' }}></AllOrderList>,
    };
    const CompOptions = useMemo(() => CompObj[orderClass], [CompObj, orderClass]);
    return CompOptions;
};
